package com.Design.Flyweight;

/**
 * @Author Lc
 * @Date 2023/10/2
 * @PackageName: com.Design.Flyweight
 * @ClassName: MainGo
 * @Description:
 */

public class MainGo {
    public static void main(String[] args){
        WebSiteFactory webSiteFactory = new WebSiteFactory();
        Web web = webSiteFactory.getWebSite("微博");
        web.use(new User("小王"));
        WebSite wb2 = webSiteFactory.getWebSite("微博");
        Web web1 = webSiteFactory.getWebSite("视频");
        web1.use(new User("小李"));
        WebSite sp2 = webSiteFactory.getWebSite("视频");

        Integer webSize = webSiteFactory.getWebSize();
        System.out.println(webSize);
    }
}
